create  table jms_dm.dm_warehousing_weight_type_sum_dt
(
    dt                          date          COMMENT '日期分区',
    network_code                varchar(255)  COMMENT '网点CODE',
    network_name                varchar(255)  COMMENT '网点名称',
    agent_code                  varchar(255)  COMMENT '代理区CODE',
    agent_name                  varchar(255)  COMMENT '代理区名称',
    city_id                     varchar(255)  COMMENT '城市ID',
    city_name                   varchar(255)  COMMENT '城市名称',
    province_id                 varchar(255)  COMMENT '省ID',
    province_name               varchar(255)  COMMENT '省',
    zone_id                     varchar(255)  COMMENT '代理区ID',
    zone_code                   varchar(255)  COMMENT '片区区CODE',
    zone_name                   varchar(255)  COMMENT '片区区名称',
    zone_staff_code             varchar(255)  COMMENT '片区负责人CODE',
    zone_staff_name             varchar(255)  COMMENT '片区负责人名称',
    area_code                   varchar(255)  COMMENT '网管片区CODE',
    area_name                   varchar(255)  COMMENT '网管片区名称',
    area_staff_code             varchar(255)  COMMENT '网管片区负责人CODE',
    area_staff_name             varchar(255)  COMMENT '网管片区负责人名称',
    weight_cnt                  bigint        COMMENT '称重票数',
    manual_weight_cnt           bigint        COMMENT '手工称重票数',
    month_acc_weight_cnt        bigint        COMMENT '月累计称重票数',
    month_acc_manual_weight_cnt bigint        COMMENT '月累计手工称重票数',
    month_acc_over_rate_cnt     bigint        COMMENT '月累计手工称重超50%次数'
)
ENGINE=OLAP
DUPLICATE KEY(dt, network_code)
comment '锁秤稽查汇总'
PARTITION BY RANGE (dt) (
   START ("2023-07-02") END ("2023-08-31") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(network_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);